import db from '../../xp/db';

export function get(pageSize, page) {
    return db.get('sys_feedbacks').query(qb => {
        qb.orderBy('createTime', 'desc');
    }).fetchPage({
        pageSize,
        page,
        withRelated: ['user']
    });
}
export function add(feedBack) {
    return db.get('sys_feedbacks').forge().save(feedBack, {method: 'insert'});
}
export function edit(version) {
    return db.get('sys_feedbacks').forge().save(version, {method: 'update'});
}
export function del(id) {
    return db.get('sys_feedbacks').forge({id}).drop();
}
